# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-mixbox
pkgname=('python2-mixbox' 'python-mixbox')
_pkgname=mixbox
pkgver=1.0.5
pkgrel=6
pkgdesc='Utility library for cybox, maec, and stix packages.'
arch=('any')
url='https://pypi.org/project/mixbox/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('cc88013146116890c7396eb1fb68022709f31f68b3d863aa2e48513b2c84285c32e322d457cb5b8fdbade785ef0c0101539d10f29941607947cbf810823aa975')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-mixbox() {
  depends=('python2' 'python2-dateutil' 'python2-lxml' 'python2-ordered-set')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-mixbox() {
  depends=('python' 'python-dateutil' 'python-lxml' 'python-ordered-set')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

